/* 播放器样式 */

/* 禁用按钮样式 */
.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-disabled:hover {
  transform: none;
}
.player-container {
  position: fixed;
  bottom: -110px; /* 默认只露出10px */
  left: 0;
  right: 0;
  background-color: var(--white);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  padding: 0 24px;
  z-index: 1000;
  transition: all 0.3s ease;
  cursor: pointer;
  height: 120px;
}

/* 鼠标移入时滑出显示完整播放器 */
.player-container:hover {
  bottom: 0;
}

/* 为了确保鼠标可以移动到播放器上，添加一个触发器区域 */
.player-container::before {
  content: '';
  position: absolute;
  top: -40px; /* 扩展可触发的区域 */
  left: 0;
  right: 0;
  height: 50px;
  background: transparent;
  pointer-events: auto;
}

/* 展开状态 - 统一由hover控制滑入滑出效果 */
.player-expanded {
  height: 120px;
  flex-wrap: wrap;
}

/* 收缩状态 - 保留高度设置 */
.player-collapsed {
  height: 50px;
  justify-content: center;
}

/* 歌曲信息部分 */
.song-info {
  display: flex;
  justify-content: center;  
  align-items: center;
  gap: 16px;
  width: 80%;
}

.player-collapsed .song-info {
  display: none;
}

.player-expanded .song-info {
  margin-bottom: 8px;
}

.song-cover {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.player-collapsed .song-cover {
  width: 40px;
  height: 40px;
}

.song-details {
  flex: 1;
  min-width: 0;
}

.song-details .song-title {
  font-size: 16px;
  color: var(--text-color);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-details .song-artist {
  font-size: 14px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-like {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.btn-like:hover {
  background-color: #f0f0f0;
}

/* 播放控制部分 */
.playback-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  width: 50%;
  transition: all 0.3s ease;
}

.player-collapsed .playback-controls {
  width: auto;
  gap: 12px;
  margin: 0 auto;
}

.btn-skip-back, .btn-skip-forward {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.btn-skip-back:hover, .btn-skip-forward:hover {
  background-color: #f0f0f0;
}

.btn-play-pause {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--primary-color);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.player-collapsed .btn-play-pause {
  width: 36px;
  height: 36px;
}

.btn-play-pause:hover {
  transform: scale(1.1);
  background-color: #40a9ff;
}

/* 进度条部分 */
.progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 24px;
  transition: all 0.3s ease;
}

.player-collapsed .progress-container {
  display: none;
}

.time-current, .time-total {
  font-size: 12px;
  color: var(--text-light);
  min-width: 40px;
  text-align: center;
}

.progress-bar {
  flex: 1;
  height: 4px;
  background-color: #d9d9d9;
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--primary-color);
  cursor: pointer;
  transition: transform 0.3s ease;
}

.progress-bar::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.progress-bar::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--primary-color);
  cursor: pointer;
  border: none;
  transition: transform 0.3s ease;
}

.progress-bar::-moz-range-thumb:hover {
  transform: scale(1.2);
}

/* 展开/收缩切换按钮 */
.btn-toggle-expand {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
  margin-left: auto;
}

.btn-toggle-expand:hover {
  background-color: #f0f0f0;
}

/* 音量控制部分 */
.volume-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 25%;
  justify-content: flex-end;
  transition: all 0.3s ease;
}

.player-collapsed .volume-controls {
  display: none;
}

.btn-volume {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.btn-volume:hover {
  background-color: #f0f0f0;
}

.volume-bar {
  width: 100px;
  height: 4px;
  background-color: #d9d9d9;
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.volume-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--text-light);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.volume-bar::-webkit-slider-thumb:hover {
  background-color: var(--text-color);
}

.volume-bar::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--text-light);
  cursor: pointer;
  border: none;
  transition: background-color 0.3s ease;
}

.volume-bar::-moz-range-thumb:hover {
  background-color: var(--text-color);
}

/* 播放列表按钮 */
.btn-playlist {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
  margin-right: 12px;
}

.btn-playlist:hover {
  background-color: #f0f0f0;
}

.btn-playlist-active {
  background-color: #f0f0f0;
}

/* 添加到播放列表按钮 */
.btn-add-to-playlist {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.btn-add-to-playlist:hover {
  background-color: #f0f0f0;
}

/* 播放列表面板 - 调整位置以适应播放器的滑入滑出效果 */
.playlist-panel {
  position: fixed;
  bottom: 130px; /* 稍微高于播放器完全展开的高度 */
  right: 24px;
  width: 400px;
  max-height: 500px;
  background-color: var(--white);
  border-radius: 8px;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.15);
  z-index: 999;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 播放列表面板头部 */
.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.playlist-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--text-color);
}

.btn-close-playlist {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-light);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.3s ease;
}

.btn-close-playlist:hover {
  background-color: #f0f0f0;
}

/* 播放列表内容区域 */
.playlist-content {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

/* 播放列表项 */
.playlist-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.playlist-item:hover {
  background-color: #f9f9f9;
}

.playlist-item-active {
  background-color: #f0f7ff;
}

.playlist-item-cover {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  margin-right: 12px;
}

.playlist-item-info {
  flex: 1;
  min-width: 0;
}

.playlist-item-title {
  font-size: 14px;
  color: var(--text-color);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item-artist {
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item-index {
  font-size: 12px;
  color: var(--text-light);
  min-width: 20px;
  text-align: center;
}

/* 播放列表为空状态 */
.playlist-empty {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  color: var(--text-light);
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .volume-controls {
    display: none;
  }
  
  .song-info {
    width: 30%;
  }
  
  .playback-controls {
    width: 70%;
  }
  
  .playlist-panel {
    width: 350px;
  }
}

@media (max-width: 768px) {
  .player-container {
    padding: 0 16px;
    height: 70px;
  }
  
  .song-cover {
    width: 48px;
    height: 48px;
  }
  
  .song-details .song-title {
    font-size: 14px;
  }
  
  .song-details .song-artist {
    font-size: 12px;
  }
  
  .playback-controls {
    gap: 16px;
  }
  
  .btn-play-pause {
    width: 40px;
    height: 40px;
  }
  
  .progress-container {
    padding: 8px 16px;
  }
  
  .playlist-panel {
    width: 90%;
    right: 5%;
    bottom: 80px;
  }
}